package me.firstapp.module.weixin.jinbi;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import me.firstapp.module.base.BaseEntity;

@Entity
@Table(name = "JINBI_ACCOUNT")
public class JinBiAccount extends BaseEntity {

	private static final long serialVersionUID = 721954443849100282L;

	// 微信openId
	@Column(name = "OPEN_ID", length = 40, unique = true, nullable = false)
	private String openId;

	// 卡号
	@Column(name = "CARD_NO", length = 40, unique = true, nullable = false)
	private String cardNo;

	/**
	 * 账号余额
	 */
	@Column(name = "BALANCE", columnDefinition = ("DECIMAL(11,4) DEFAULT '0.0000'   "), nullable = false)
	private BigDecimal balance;

	/**
	 * 起初金额
	 */
	@Column(name = "BALANCE_BEGIN", columnDefinition = ("DECIMAL(11,4) DEFAULT '0.0000'   "), nullable = false)
	private BigDecimal balanceBegin;

	/**
	 * 最后变更时间
	 */
	@Column(name = "UPDATE_TIME")
	private Date updateTime;

	/**
	 * 加密串
	 */
	@Column(name = "ENCRYPTION", length = 100, nullable = false)
	private String encryption;

	// 用户名
	@Transient
	private String name;

	// 头像地址
	@Transient
	private String avatar;

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public BigDecimal getBalanceBegin() {
		return balanceBegin;
	}

	public void setBalanceBegin(BigDecimal balanceBegin) {
		this.balanceBegin = balanceBegin;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getEncryption() {
		return encryption;
	}

	public void setEncryption(String encryption) {
		this.encryption = encryption;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

}
